<partial name="_PartialQuote" model="@("netnrnav.css,netnrnav.js")" />

<!--顶部导航-->
@{ bool IsLogin = ViewContext.HttpContext.User.Identity.IsAuthenticated;}

<button type="button" class="MenuToggle show-in-mobile btn btn-primary ml-3 mt-3">
    <span class="fa fa-align-justify fa-2x"></span>
</button>
<div class="netnrnav horizontal">
    <div class="netnrnav-wrapper">
        <ul>
            <li><a href="/" class="siteIcon"><img src="/favicon.svg" /> 首页</a></li>
            <li><a href="/gist/discover" title="代码片段"><span class="fa fa-fw fa-file-code-o"></span> Gist</a></li>
            <li><a href="/run/discover" title="在线运行代码"><span class="fa fa-fw fa-play"></span> Run</a></li>
            <li><a href="/doc" title="文档管理"><span class="fa fa-fw fa-book"></span> Doc</a></li>
            <li><a href="/draw/discover" title="绘制"><span class="fa fa-fw fa-paint-brush"></span> Draw</a></li>
            <li><a href="https://ss.netnr.com" title="Script Services"><span class="fa fa-fw fa-wrench"></span> 服务</a></li>
            <li>
                <a class="text-muted"><span class="fa fa-fw fa-ellipsis-h"></span></a>
                <ul>
                    <li><a href="/mix/about"><i class="fa fa-fw fa-info"></i> 关于</a></li>
                    <li><a href="/lab"><i class="fa fa-fw fa-flask"></i> 实验室</a></li>
                    <li><a href="/store"><i class="fa fa-fw fa-hdd-o"></i> 云存储</a></li>
                    <li class="divider"></li>
                    <li><a target="_blank" title="码云" href="https://gitee.com/netnr"><i class="fa fa-fw fa-git"></i> Gitee <sup><i class="fa small fa-external-link"></i></sup></a></li>
                    <li><a target="_blank" title="GitHub" href="https://github.com/netnr"><i class="fa fa-fw fa-github"></i> GitHub <sup><i class="fa small fa-external-link"></i></sup></a></li>
                </ul>
            </li>
        </ul>
        <ul class="float-right">
            @if (IsLogin)
            {
                var uinfo = new UserAuthAid(ViewContext.HttpContext).Get();
                var num = Common.NewMessageQuery(uinfo.UserId);

                <li>
                    <a href="/user/message">
                        @if (num > 0)
                        {
                            <span title="有新消息" class="fa fa-fw fa-bell text-info"></span><b class="text-danger">@num</b>
                            <script>document.title = "【@num】条新消息";</script>
                        }
                        else
                        {
                            <span title="暂无消息" class="fa fa-fw fa-bell"></span>
                        }
                    </a>
                </li>
                <li>
                    <a>
                        @*<span class="fa fa-fw "></span>*@
                        <img src="~/gs/static/avatar/@uinfo.UserPhoto" style="width:22px;" />
                        <span class="indicator fa fa-sort-desc"></span>
                    </a>
                    <ul>
                        <li><a href="/user/id/@uinfo.UserId"><span class="fa fa-fw fa-user text-primary"></span> 我的主页</a></li>
                        <li><a href="/user/setting"><span class="fa fa-fw fa-cog text-primary"></span> 个人设置</a></li>
                        <li class="divider"></li>
                        <li><a href="/note"><i class="fa fa-fw fa-file-text-o"></i> 记事本</a></li>
                        <li class="divider"></li>
                        <li><a href="/home/write"><span class="fa fa-fw fa-pencil text-info"></span> 写</a></li>
                        <li><a href="/user/write"><span class="fa fa-fw fa-file-text-o text-info"></span> 我的文章</a></li>
                        <li><a href="/user/write/laud"><span class="fa fa-fw fa-thumbs-up text-success"></span> 我的点赞</a></li>
                        <li><a href="/user/write/mark"><span class="fa fa-fw fa-cube text-info"></span> 我的收藏</a></li>
                        <li class="divider"></li>
                        <li><a href="/account/logout"><span class="fa fa-fw fa-power-off text-danger"></span> 退出</a></li>
                    </ul>
                </li>
            }
            else
            {
                <li><a href="/account/login" class="text-primary">登录 / 注册</a></li>
            }
        </ul>
    </div>
</div>
<div style="height:40px"></div>